import Common from "./Common";
import {reactive, watch} from 'vue'
import * as vuex from 'vuex'
import * as vueRouter from 'vue-router'

const {ccclass, property} = cc._decorator;

@ccclass
export default class Demo extends cc.Component {


    start() {
        new Common()

        // 方式二： 只能传入引用类型的值
        const data = reactive({
            tableData: [
                {
                    name: '姓名1'
                }
            ]
        })

        // 监听reactive创建的响应式变量,可以直接监听对象，必须使用内联函数
        watch(() => data.tableData, (now, prev) => {
            console.log(now, prev, typeof now)
        })
        data.tableData = []

        console.log(vuex, vueRouter)
    }

}
